import request from '@/utils/request'

export default {
//获取坐席数据
  queryAgent(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/fleetManage/queryAgent',
      method: 'post',
      data
    });
  },
  //根据类型，获取坐席数据（aoc坐席、非aoc坐席）
  queryAgentByType(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/fleetManage/queryAgent',
      method: 'post',
      data
    });
  },
  /**
   * 1.查询接口  传入参数：address  返回：isp_agent对应数据 （支持分页）
   * @param data
   */
  qryUserAgantBAddress(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/qryUserAgent',
      method: 'post',
      data
    });
  },/**
   * 2.更新接口： 传入参数：userId，address，leftExt, isStart，agent_name修改isp_agent对应数据(如果参数undefined则不修改)
   * @param data
   */
  updateUserAgent(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/updateUserAgent',
      method: 'post',
      data
    });
  },
  /**
   * 编辑坐席
   * @param data
   */
  editAgent(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/editAgent',
      method: 'post',
      data
    });
  },
  /**
   * 新增坐席
   * @param data
   */
  insertAgent(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/insertAgent',
      method: 'post',
      data
    });
  }, /**
   * 查询userid，存在则清空
   * @param data
   */
  clearUserAgentByUserId(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/clearUserAgentByUserId',
      method: 'post',
      data
    });
  },
  /**
   * let data = {
          user_id: this.user.userId,
          // user_id: '',清空user则不传user_id
          agentId:agent_id
        }
   * @param data
   */
  clearUserAgent(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/clearUserAgent',
      method: 'post',
      data
    });
  },clearUser(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/clearUser',
      method: 'post',
      data
    });
  },
  /**
   * 2.更新接口： 传入参数：userId，address，leftExt, isStart，agent_name修改isp_agent对应数据(如果参数undefined则不修改)
   * @param data
   */
  updateUserLeftExt(data) {
    return request({
      // ContentType: 'application/x-www-form-urlencoded',
      // ContentType: 'application/json',
      url: '/scs/userManage/updateUserLeftExt',
      method: 'post',
      data
    });
  },
}
